<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>gTime Settings</title>
	<link type="text/css" rel="stylesheet" href="/stylesheets/gtime.css" />
	<link rel="shortcut icon" href="static/favicon.ico" />

	<script type="text/javascript" src="./static/json2.js"></script>
	<script type="text/javascript" src="./static/rpchelpers.js"></script>



  <script type="text/javascript">

  var server = {};

  InstallFunction(server, 'SaveSettings');

  function $(id){
    return document.getElementById(id);
  }

  function doSave() {
	settings = new Object();
	settings.statement_header = $('statement_header_text').value;
	settings.hourly_rate = $('hourly_rate').value;
    server.SaveSettings(settings, onSaveSuccess);
  }

  function onSaveSuccess(response) {
	var elem = $('status_message');
	elem.innerHTML = response;
  }

</script>

	
</head>
  <body>
	{% include "header.html" %}
	<div id="body">	
		<div id="center_content">
			<div id="status_message"></div>
			<div id="settings">
				<table>
					<tr>
						<th>Statement header:</th>
						<td><textarea id="statement_header_text" name="statement_header_text" cols="40" contenteditable="true" rows="5">{{ settings.statement_header }}</textarea></td>
					</tr>
					<tr>
						<th>Default hourly rate:</th>
						<td><input id="hourly_rate" type="text" size="10" name="hourly_rate" value="{{settings.hourly_rate}}"></td>
					</tr>
				</table>
			</div>
			<br/>
			<div id="buttons"><b><a href="/">« Back to gTime</a></b>
				<input id="save_button" name="save_button" type="button" value="Save" onclick="doSave()">
			</div>
		</div>
	<div>
	{% include "footer.html" %}
  </body>
</html>
